//
//  HomeHeadView.swift
//  Xiaozihui
//
//  Created by 校企荟 on 2017/8/23.
//  Copyright © 2017年 校企荟. All rights reserved.
//

import UIKit
import SDCycleScrollView

class HomeHeadView: UIView {

    lazy var dateLbl: UILabel = {
        let lbl = UILabel(content: "2017/10", textFont: UIFont.boldSystemFont(ofSize: 33 * ScaleX), color: mainColor, alignment: .center, numberOfLine: 1)
        return lbl
    }()
    
    lazy var weekLbl: UILabel = {
        let lbl = UILabel(content: "星期五", textFont: UIFont.systemFont(ofSize: 21 * ScaleX), color: mainColor, alignment: .center, numberOfLine: 1)
        return lbl
    }()
    
    lazy var dayLbl: UILabel = {
        let lbl = UILabel(content: "14", textFont: UIFont.boldSystemFont(ofSize: 47*ScaleX), color: UIColor.white, alignment: .center, numberOfLine: 1)
        return lbl
    }()
    
    lazy var roundIV: UIImageView = {
        let iv = UIImageView(frame: CGRect(x: 0, y: 0, width: 100 * ScaleX, height: 100 * ScaleX))
        iv.layer.cornerRadius = 50 * ScaleX
        iv.layer.masksToBounds = true
        iv.backgroundColor = mainColor
//        iv.layer.shadowOffset = CGSize(width: 5, height: 5)
//        iv.layer.shadowColor = UIColor.groupTableViewBackground.cgColor
        return iv
    }()
    
    override init(frame: CGRect) {
        super.init(frame: CGRect(x: 0, y: 0, width: ScreenWidth, height: 124 * ScaleX))
        setupUI()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

    func setupUI() {
       
    
        backgroundColor = #colorLiteral(red: 0.3333333333, green: 0.2274509804, blue: 0.2352941176, alpha: 1)
        
        addSubview(dateLbl)
        addSubview(weekLbl)
        addSubview(roundIV)
        addSubview(dayLbl)
        
        dateLbl.snp.makeConstraints { (make) in
            make.top.equalTo(self).offset(20 * ScaleX)
            make.left.equalTo(self).offset(40)
        }
        
        weekLbl.snp.makeConstraints { (make) in
            make.left.equalTo(dateLbl)
            make.top.equalTo(dateLbl.snp.bottom).offset(15 * ScaleX)
        }
        
        roundIV.snp.makeConstraints { (make) in
            make.width.height.equalTo(100 * ScaleX)
            make.centerY.equalTo(self)
            make.right.equalTo(self).offset(-40 + ScaleX)
        }
        
        dayLbl.snp.makeConstraints { (make) in
            make.center.equalTo(roundIV)
        }
    }
    
}


